import Vue from 'vue'
import VueRouter from 'vue-router'

import Home from '../views/Home.vue'
import User from '../views/User.vue'
import Question from '../views/Question.vue'
import Contest from '../views/Contest.vue'
import Search from '../views/Search.vue'
import Team from '../views/Team.vue'
import Answersheet from '../views/answersheet.vue'

import PersonalHome from '../components/PersonalHome.vue'
import PersonalSetting from '../components/PersonalSetting.vue'
import Security from '../components/Security.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/search',
    name: 'Search',
    component: Search
  },
  {
    path: '/question',
    name: 'Question',
    component: Question
  },
  {
    path: '/contest',
    name: 'Contest',
    component: Contest
  },
  {
    path: '/team',
    name: 'Team',
    component: Team
  },
  { path: '/answersheet',
   component: Answersheet },
  {
    path: '/user',
    name: 'User',
    component: User,
    children: [
      {
        path: '',
        component: PersonalHome
      },
      {
        path: 'home',
        name: 'PersonalHome',
        component: PersonalHome
      },
      {
        path: 'setting',
        name: 'PersonalSetting',
        component: PersonalSetting
      },
      {
        path: 'security',
        name: 'Security',
        component: Security
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
